Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow to open a PR to the next stage when the stage of an RFC has been updated #844

Merged
merged 12 commits into from
Nov 22, 2022

Conversation

kategengler
Copy link
Member

@kategengler kategengler commented Aug 11, 2022

TODO

  • Create a github user with only access to emberjs/rfcs. Get a personal access token with scope 'repo' and add to the repo's secrets under PERSONAL_ACCESS_TOKEN. This is required so that the opened PRs will trigger the regular github actions.
  • Update the workflow to use a released version of embers/rfcs-tooling once Add scripts to support workflows to open PRs as RFCs advance through stages rfcs-tooling#9 is merged
  • After merging, make checks for newly opened RFCs required. They will pass on PRs that do not add an RFC.

Advance RFC workflow

  • Fails if more than one RFC has been updated in a single push
  • Uses templates in .github/PULL_REQUEST_TEMPLATE for the body of the
    opened RFCs, with substitution of specific variables
  • Sets labels on the new PR
  • Updates the newly opened PR with a commit that adds the the link to
    the PR to the metadata

Example PRs

Newly opened RFC workflow

  • Checks filename matches PR number
  • Ensures Stage in frontmatter is 'accepted' before merge
  • Ensures label 'S-Exploring' has been added before merge
  • Ensures the PR is not labeled both 'S-Exploring' and 'S-Proposed'
  • Ensures only one RFC is added in a PR
  • Checks prs.accepted is correct URL

Example

Label New RFC workflow

  • Adds S-Proposed label to newly opened PRs that add an RFC

Triggering open advancement PR

This is a workflow triggered by workflow_dispatch, either manually or through the REST API. Given an input rfc-path it will determine the next stage, if any, from that RFC and open a PR to advance, if necessary. We can use this workflow + the REST API to open advancement PRs for existing RFCs that are incomplete. Before we start merging RFCs with stages, we can safely run this workflow for all existing RFCs to open the advancement PRs in bulk.

@kategengler kategengler force-pushed the kg-workflow-to-advance-rfcs branch from 24ee145 to 45e0054 Compare August 11, 2022 21:12
@kategengler kategengler marked this pull request as ready for review August 19, 2022 18:15
This was referenced Aug 19, 2022
Copy link
Member

@wagenet wagenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I will admit that I did not read all of the code. Let me know if you think it needs more careful review.

@kategengler
Copy link
Member Author

I think it's fine. There are probably better ways to do some of it, but it works and should be relatively maintainable 🤞

@kategengler
Copy link
Member Author

Created user @emberjs-rfcs-bot for the token

has been updated

- Fails if more than one RFC has been updated in a single push
- Uses templates in .github/PULL_REQUEST_TEMPLATE for the body of the
  opened RFCs, with substitution of specific variables
- Sets labels on the new PR
- Updates the newly opened PR with a commit that adds the the link to
  the PR to the metadata
markdown. It renders line breaks that would otherwise be ignored. This
removes all linebreaks of convenience from the templates so that they
will render according to available width in the PR body
recommended

Open advancement PRs as drafts
Enumerate teams in Ready for Release template along with github team
names for ease of reference when assigning
`S-Proposed`

Reconfigure GH actions to use composite actions and as multiple jobs so
it is easy to see when they decide not to run based on the scenario
@kategengler kategengler force-pushed the kg-workflow-to-advance-rfcs branch from 21c0c27 to be19c92 Compare November 10, 2022 16:56
- Convert from deprecated set-ouput to Github's env files system
- Document the workflows and actions and methods of testing
- Add some additional outputs for easier debugging
Copy link
Member

@wagenet wagenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not carefully review every line, but the overall setup looks good.

to the primary branch. Generate an artifact file of data when new PRs to advance
are opened.
@kategengler kategengler merged commit 7102e36 into emberjs:master Nov 22, 2022
@kategengler kategengler deleted the kg-workflow-to-advance-rfcs branch November 22, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants